package com.igoal.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "privacy_setting")
public class PrivacySetting implements Serializable {

	private static final long serialVersionUID = 1440115105021291450L;

	private Integer id;
	private PrivacyEnum level;
	private Date cdate;
	private Date mdate;
	private Set<UserThought> userThoughts = new HashSet<UserThought>(0);
	private Set<UserGoalDone> goalEntryDones = new HashSet<UserGoalDone>(0);
	private Set<UserGoal> userGoals = new HashSet<UserGoal>(0);
	private Set<WallUpdate> wallUpdates = new HashSet<WallUpdate>(0);
	private Set<UserGoalEntry> goalEntries = new HashSet<UserGoalEntry>(0);

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Enumerated(EnumType.STRING)
	@Column(name = "level", nullable = false, length = 45)
	public PrivacyEnum getLevel() {
		return this.level;
	}

	public void setLevel(PrivacyEnum level) {
		this.level = level;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "cdate", nullable = false, length = 19)
	public Date getCdate() {
		return this.cdate;
	}

	public void setCdate(Date cdate) {
		this.cdate = cdate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "mdate", nullable = false, length = 19)
	public Date getMdate() {
		return this.mdate;
	}

	public void setMdate(Date mdate) {
		this.mdate = mdate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "privacy")
	public Set<UserThought> getUserThoughts() {
		return this.userThoughts;
	}

	public void setUserThoughts(Set<UserThought> userThoughts) {
		this.userThoughts = userThoughts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "privacy")
	public Set<UserGoalDone> getGoalEntryDones() {
		return this.goalEntryDones;
	}

	public void setGoalEntryDones(Set<UserGoalDone> goalEntryDones) {
		this.goalEntryDones = goalEntryDones;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "privacy")
	public Set<UserGoal> getUserGoals() {
		return this.userGoals;
	}

	public void setUserGoals(Set<UserGoal> userGoals) {
		this.userGoals = userGoals;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "privacy")
	public Set<WallUpdate> getWallUpdates() {
		return this.wallUpdates;
	}

	public void setWallUpdates(Set<WallUpdate> wallUpdates) {
		this.wallUpdates = wallUpdates;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "privacy")
	public Set<UserGoalEntry> getGoalEntries() {
		return this.goalEntries;
	}

	public void setGoalEntries(Set<UserGoalEntry> goalEntries) {
		this.goalEntries = goalEntries;
	}

}
